package com.atguigu.rabbitmq.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import sun.applet.resources.MsgAppletViewer;

import java.io.UnsupportedEncodingException;

/**
 * FanoutListener2
 *
 * @Author: 马伟奇
 * @CreateTime: 2021-02-24
 * @Description:
 */
public class FanoutListener2 implements MessageListener {
    @Override
    public void onMessage(Message message) {
        try {
            String msg = new String(message.getBody(), "utf-8");
            System.out.println(msg);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}